﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YXShop.TemplateAction
{
    public partial class LabelParse
    {
        public string ProductListMakeup()
        {
            string mystyle = this.Label_Inserted;
            string FileName = this.GetParamValue("YX:FileName");
            YXShop.Common.SysParameter sp=new YXShop.Common.SysParameter();
            if (!string.IsNullOrEmpty(mystyle))
            {
                if (mystyle.IndexOf("[#Compositor_Price]") > -1)
                {
                    string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("q_Sort=Pro_ShopPrice", "") + ">价格</a>";
                    mystyle = mystyle.Replace("[#Compositor_Price]", hrefs);
                }
                if (mystyle.IndexOf("[#Compositor_Time]") > -1)
                {
                    string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("q_Sort=Pro_AutoUp", "") + ">上架时间</a>";
                    mystyle = mystyle.Replace("[#Compositor_Time]", hrefs);
                }
                if (mystyle.IndexOf("[#Compositor_AllShow]") > -1)
                {
                    string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("q_Sort=Pro_Id","") + ">默认显示</a>";
                    mystyle = mystyle.Replace("[#Compositor_AllShow]", hrefs);
                }
                if (!string.IsNullOrEmpty(FileName))
                {
                    if (mystyle.IndexOf("[#Makeup_Pic]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName) + ">按缩略图方式查看</a>";
                        mystyle = mystyle.Replace("[#Makeup_Pic]", hrefs);
                    }
                    if (mystyle.IndexOf("[#Makeup_List]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName + "2") + ">按列表方式查看</a>";
                        mystyle = mystyle.Replace("[#Makeup_List]", hrefs);
                    }
                    if (mystyle.IndexOf("[#Makeup_Images_List]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName + "3") + ">按图片方式查看</a>";
                        mystyle = mystyle.Replace("[#Makeup_Images_List]", hrefs);
                    }
                    
                    if (mystyle.IndexOf("[#Makeup_Pic_Images]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName) + "><img src='" + sp.DummyPaht + sp.WebSiteTemplatePath + "/images/Images_ListShow.gif' border='0' alt='切换到缩略图显示'></a>";
                        mystyle = mystyle.Replace("[#Makeup_Pic_Images]", hrefs);
                    }
                    if (mystyle.IndexOf("[#Makeup_List_Images]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName + "2") + "><img src='" + sp.DummyPaht + sp.WebSiteTemplatePath + "/images/Pic_ListShow.gif' border='0' alt='切换到列表显示'></a>";
                        mystyle = mystyle.Replace("[#Makeup_List_Images]", hrefs);
                    }
                    if (mystyle.IndexOf("[#Makeup_Images_Images]") > -1)
                    {
                        string hrefs = "<a href=" + YXShop.TemplateAction.Common.URL("", FileName + "3") + "><img src='" + sp.DummyPaht + sp.WebSiteTemplatePath + "/images/images_Show.gif' border='0' alt='切换到图片显示'></a>";
                        mystyle = mystyle.Replace("[#Makeup_Images_Images]", hrefs);
                    }
                }


            }
            return mystyle;
        }
    }
}
